//
//  BusinessService+FJ.m
//  SelfDriving
//
//  Created by apple on 16/2/24.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "BusinessService+FJ.h"
#import "FJModel.h"
#import "KPAnalyzeModel.h"
@implementation BusinessService(FJ)


-(void)getADlist:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:GETADLIST
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   FJModel *focusModel = [[FJModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}

-(void)getdynamic_unreadnum:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    
    [self.http sendRequest:dynamic_unreadnum
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           success(newsObjs);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}

-(void)getdynamic_nearby:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamic_friend
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [[result objectForKey:@"data"] objectForKey:@"personlist"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}
//获取快拍列表数据
-(void)kuaipai_list:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:kuaipai_listurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)dtaiguangg:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamic_friend
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       
                       
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [[result objectForKey:@"data"] objectForKey:@"advlist"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               
                               for (id newsObj in newsObjs) {
                                   
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   
                                   [focusModel serializationWithDictionary:newsObj];
                                   
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)nearby:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:nearbyurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       
                       NSArray * colorArr = @[@"#F0E2DD",@"#E9F2EF",@"#DDE4EF",@"#F3F0DA"];
                       
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [NSMutableArray array];
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               
                               
                               [focusModel serializationWithDictionary:newsObjs];
                               
                               [userlist addObject:focusModel];
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}

-(void)getdynamic_friend:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamic_friendurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [[result objectForKey:@"data"] objectForKey:@"personlist"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}
-(void)friendlist:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:friendlisturl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               [focusModel serializationWithDictionary:newsObjs];
                               [userlist addObject:focusModel];
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)kuaipai_admin_setting:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:kuaipai_admin_settingurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           success(dic);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)kuaipai_zan:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    NSLog(@"%@",parameters);
    [self.http sendRequest:kuaipai_zanurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           success(dic);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)enterGroup:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
     [self.http sendRequest:enterGroupurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               [focusModel serializationWithDictionary:newsObjs];
                               success(focusModel);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];

}
-(void)myfollow:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:myfollowurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
    
}
-(void)changjing_nearby_persons:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:changjing_nearby_personsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];

}
-(void)addqunliao:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:addqunliaourl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               [focusModel serializationWithDictionary:newsObjs];
                               success(focusModel);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)kuaipai_automeeting:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:kuaipai_automeetingurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           success(dic);
                        } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];


}
-(void)kuaipai_endMeeting:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:kuaipai_endMeetingurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           success(dic);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}

-(void)kuaipai_delete:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure {
    
    [self.http sendRequest:kuaipai_deleturl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:POST_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                          
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([[dic objectForKey:@"code"] intValue]== 0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               [focusModel serializationWithDictionary:newsObjs];
                               success(focusModel);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];

}

-(void)kuaipai_detail:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:kuaipai_detailurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               [focusModel serializationWithDictionary:newsObjs];
                               success(focusModel);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];

}
-(void)getdynamic_detail:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamic_detailurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableDictionary *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               DTModel *focusModel = [[DTModel alloc] init];
                               [focusModel serializationWithDictionary:newsObjs];
                               [userlist addObject:focusModel];
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}


-(void)publish_dynamic:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:publish_dynamicurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           [loginModel serializationWithDictionary:[result objectForKey:@"data"]];
                           loginModel.data = [[NSMutableDictionary alloc]init];
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}

-(void)addreply:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamiccommenturl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           [loginModel serializationWithDictionary:[result objectForKey:@"data"]];
                           loginModel.data = [[NSMutableDictionary alloc]init];
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)praise:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamiczanurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           [loginModel serializationWithDictionary:[result objectForKey:@"data"]];
                           loginModel.data = [[NSMutableDictionary alloc]init];
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];}


-(void)getalbum_list:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:album_listurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           
                           
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               
                               
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}
//获取快拍详细里面最新用户头像
-(void)lastUserHeads:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:lastUserHeadsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)getdynamic_list:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamic_listurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [[result objectForKey:@"data"] objectForKey:@"personlist"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)dynaimc_statistics:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynaimc_statisticsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   DTModel *focusModel = [[DTModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}

-(void)kuaipai_statistics:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:kuaipai_statisticsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   KPAnalyzeModel *focusModel = [[KPAnalyzeModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
            
                                   
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
@end
